package com.nightpiter.controller.threads;

import android.os.Handler;

import com.nightpiter.controller.algorithms.MetroRouter;
import com.nightpiter.model.objects.Station;

/**
 * RouterPreparerThread class.
 * 
 * @author Eldar Abusalimov (eldar.abusalimov@gmail.com)
 */
public class RouterPreparerThread extends Thread {

	/**
	 * station to search routes from
	 */
	private Station fromStation;

	/**
	 * MetroRouter instance
	 */
	private MetroRouter router;

	/**
	 * handler from UI thread
	 */
	private Handler handler;
	
	/**
	 * default constructor
	 */
	public RouterPreparerThread(Station fromStation, MetroRouter router, Handler handler) {
		super("RouterPreparerThread");
		this.fromStation = fromStation;
		this.router = router;
		this.handler = handler;
	}

	@Override
	public void run() {
		super.run();
		router.prepare(fromStation, handler);			
	}

}
